<template>
  <div id="app">
    <img src="./assets/logo.png">
    <ul>
      <li><router-link to="/">首页</router-link> </li>
      <li><router-link to="/product/111">美女图片</router-link> </li>
      <li><router-link to="/pets">宠物图片</router-link> </li>
      <button type="button" @click="btnfn">点我</button>
      <br>
    </ul>

    <!--  <router-view/> 使用路由规则替换成对应的组件  -->
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App',
  methods:{
    btnfn(){
      //代替router-link实现路由跳转
      this.$router.push("/Product/1");
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
  width: auto;
  margin-left: 30%;
  margin-right: 30%;
}
li{
  list-style: none;
  margin-right: 10px;
  float: left;
}
</style>
